from flask import Flask
import config
from exts import db, login_manager
#from models import UserModel
from models import Admin
from models import Book
from models import Student
from models import Inventory
from models import ReadBook
from models import PostModel
from models import CommentsModel
from models import AnnounceModel

# from blueprints.qa import bp as qa_bp
# from blueprints.auth import bp as auth_bp
from blueprints.main import main
from blueprints.student import student
from blueprints.community import community
from flask_migrate import Migrate


app = Flask(__name__, static_folder='static')
app.config['SECRET_KEY'] = 'hard to guess string'
# 绑定配置文件
app.config.from_object(config)

db.init_app(app)

migrate = Migrate(app, db)
login_manager.init_app(app)
# app.register_blueprint(qa_bp)
# app.register_blueprint(auth_bp)
app.register_blueprint(main)
app.register_blueprint(student)
app.register_blueprint(community)




if __name__ == '__main__':
    app.run()
